<html>
<head>
<title>History View</title>
</head>
<body>
<form action="/admin/histories" method="get">
Select Protocol: <select name="type" onchange="javascript:this.form.submit()">
{% ifequal type "OCC"%}
<option name="SS2PL">SS2PL</option>
<option name="OCC" selected>OCC</option>
{% else %}
<option name="SS2PL" selected>SS2PL</option>
<option name="OCC">OCC</option>
{% endifequal %}
</select>
</form>

<h2>{{type}} History</h2>
{% ifequal type "OCC"%}
	<table border="1">
		<tr>
			<th>Sequence No</th>
			<th>Transaction Id</th>
			<th>Operation Type</th>
			<th>Operation Data Item</th>
			<th>Operation Data Item Value (the value read or written)</th>
			<th>Timestamp</th>
		</tr>
	{% for lr in logrecords%}
		<tr>

			<td>{{lr.trans.sno}}&nbsp;</td>
			<td>{{lr.trans.tid}}&nbsp;</td>
			<td>{{lr.optype}}&nbsp;</td>
			<td>{{lr.din}}&nbsp;</td>
			<td>{{lr.div}}&nbsp;</td>
			<td>{{lr.la}}&nbsp;</td>
		</tr>
	{% endfor %}	
</table>
{% else %}
<table border="1">
		<tr>
			<th>Operation Type</th>
			<th>Inverse Operation?</th>
			<th>Transaction Id</th>		
			<th>Operation Data Item</th>
			<th>Operation Data Item Value (the value read or written)</th>
			<th>Timestamp</th>
		</tr>
	{% for lr in logrecords%}
		<tr>
			<td>{{lr.optype}}&nbsp;</td>	
			<td>{{lr.isinverseop}}&nbsp;</td>
			<td>{{lr.transaction.tid}}&nbsp;</td>
			<td>{{lr.din}}&nbsp;</td>
			<td>{{lr.div}}&nbsp;</td>
			<td>{{lr.la}}&nbsp;</td>
		</tr>
	{% endfor %}	
</table>
{% endifequal %}
</body>
</html>
